﻿using System;
using System.Linq;
using DistributeTransaction.Models;

namespace DistributeTransaction.DAL
{
    public class CustomerRepository : GenericRepository<Customer>
    {
        public CustomerRepository(DatabaseContext context)
            : base(context)
        {

        }

        public Customer GetByLoginName(string name)
        {
            const string query = @"SELECT [UserId], [UserName] 
FROM [dbo].[aspnet_Users] 
WHERE [UserName] = @p0";
            return GetWithRawSql(query, name).FirstOrDefault();
        }
    }
}